﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Catering_Rules;
using System.Data;

namespace Catering.Catering_Page.system
{
    public partial class DishAreaReset : UserIsNull
    {
        T_Dish tDish = new T_Dish();

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        //重置菜品所属区域
        protected void Btn_DishAreaReset_Click(object sender, EventArgs e)
        {
            DataTable DishDt = tDish.GetList("").Tables[0];
            for (int i = 0; i < DishDt.Rows.Count; i++)
            {
                tDish.UpdateAreaIDByDishID(int.Parse(DishDt.Rows[i]["id"].ToString()));
            }
            ClientScript.RegisterClientScriptBlock(Page.GetType(), "alert", "<script>alert('更新完成（" + DishDt.Rows.Count.ToString() + "）！');</script>");
        }
    }
}